package com.firegod.oss;

import lombok.Setter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties("aliyun.oss.file")
@Setter //必须加Set方法
public class OSSConstantProperties implements InitializingBean {
    public static String END_POINT;
    public static String KEY_ID;
    public static String KEY_SECRET;
    public static String BUCKET_NAME;
    /**
     * 存储节点地址
     */
    private String endpoint;
    /**
     * 秘钥id
     */
    private String keyid;
    /**
     * 密匙
     */
    private String keysecret;
    /**
     * 文件夹名称
     */
    private String bucketname;

    @Override
    public void afterPropertiesSet() {
        END_POINT = endpoint;
        KEY_ID = keyid;
        KEY_SECRET = keysecret;
        BUCKET_NAME = bucketname;
    }
}
